package com.nowcoder.community.service;

import com.nowcoder.community.dao.CommentMapper;
import com.nowcoder.community.entity.Comment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author Cl
 * @Date 2024-2024/5/3  20:21
 * @Description todo
 */
@Service
public class CommentService {

    @Autowired
    private CommentMapper commentMapper;

    /*分页展示评论 回复*/
    public List<Comment> findCommentByEntity(int entityType, int entityId , int offset , int limit){
        return commentMapper.selectCommentByEntity(entityType,entityId,offset , limit);
    }

    /**评论 回复 数量*/
    public int findCommentCount(int entityType , int entityId){
        return commentMapper.selectCountByEntity(entityType , entityId);
    }
}
